<template>
    <el-upload
        class="upload-demo"
        drag
        v-if="obj.drag"
        :multiple="obj.multiple"
        :action="obj.action"
    >
        <el-icon class="el-icon--upload">
            <component is="el-icon-upload"></component>
        </el-icon>
        <div class="el-upload__text">
            {{ obj.upload_text }}
        </div>
    </el-upload>
    <el-upload v-else class="upload-demo"
               :multiple="obj.multiple" :action="obj.action">
        <el-button :color="obj.color || buttonColor" type="primary">{{ obj.button }}</el-button>
    </el-upload>

</template>

<script>
import {mapState} from "vuex";

export default {
    name: "jUpload",
    props: {
        obj: Object
    },
    computed:{
        ...mapState(['buttonColor'])
    }
}
</script>

<style scoped>

</style>
